package edu.nf.project.schedule;

import edu.nf.project.services.other.DishInventoryCheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author gjh
 * @Date 2025/6/18
 * @Description:
 */
@Component
public class DishInventoryScheduler {
    @Autowired
    private DishInventoryCheckService dishInventoryCheckService;

    @Scheduled(cron = "*/3 * * * * ?") // 每3秒执行一次
    public void runInventoryCheck() {
        dishInventoryCheckService.checkAndUpdateDishStatus();
    }
}
